<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<%@include file="../taglibs.jsp" %>
<script type="text/javascript">
	
	$(function(){
		$("#query").click(function(){
			$("#roleForm").submit();
		})
	})
	
	function grantRole(empId){
		
		var  flag = "";
		var ids = "";
		$("tbody input:checked").each(function(){
			ids = ids + $(this).val()+",";
			
		})
		$.ajax({
			url:"${path}/role_grant",
			type:"post",
			dataType:"text",
			async:false,//设置ajax同步
			/* data:{
				ids:ids,
				"erpQuery.empId":empId
			}, */
			data:"ids="+ids+"&erpQuery.empId="+empId,
			success:function(responseText){
				flag = responseText;
			}
		});
		return flag;
	}
</script>
<div class="content-right">
	<div class="content-r-pic_w">
		<div style="margin:8px auto auto 12px;margin-top:6px">
			<span class="page_title">角色管理</span>
		</div>
	</div>
	<div class="content-text">
		<form id="roleForm" action="${path }/role_poplist" method="post"> 
			
			<input type="hidden" name="erpQuery.empId" value="<s:property value="erpQuery.empId"/>">
			<div class="square-o-top">
				<table width="100%" border="0" cellpadding="0" cellspacing="0"
					style="font-size:14px; font-weight:bold; font-family:"黑体";">
					<tr>
						<td width="68" height="30">&nbsp;</td>
						<td width="123">&nbsp;</td>
						<td width="62">角色名称</td>
						<td width="142">
							<s:textfield  size="18" name="erpQuery.name"></s:textfield>
						</td>
						<td width="60">角色编码</td>
						<td width="149">
							<s:textfield  size="18" name="erpQuery.code"></s:textfield>
						</td>
						<td width="70"><a id="query" href="#"> <img src="${path}/images/can_b_01.gif" border="0" /> </a></td>
						
					</tr>
				</table>
			</div>
			<!--"square-o-top"end-->
			<div class="square-order">
				<table width="100%" border="1" cellpadding="0" cellspacing="0">
					<tr align="center"
						style="background:url(${path}/images/table_bg.gif) repeat-x;">
						<td width="20%"><input type="checkbox" id="checkAll"></td>
						<td width="40%" height="30">角色名称</td>
						<td width="40%">角色编码</td>
						
					</tr>
					<tbody>
					<s:iterator value="#rlist" var="role">
					<tr align="center" bgcolor="#FFFFFF">
						<td height="30"><input type="checkbox" <s:if test="#role.checked == 'yes'">checked</s:if> value="<s:property value="#role.roleId"/>"></td>
						<td height="30"><s:property value="#role.name"/></td>
						<td><s:property value="#role.code"/></td>
						
					</tr>
					</s:iterator>
					</tbody>
					
					
				</table>
			</div>
		</form>
	</div>
	<div class="content-bbg"></div>
</div>
